package cn.com.twoke.easyproject.aspect.request.lock.hook.after;

import cn.com.twoke.easyproject.aspect.request.lock.RequestLock;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;

/**
 * 给生成的请求锁key添加前缀
 */
public class GenerateKeyAfterWithPrefix implements GenerateKeyHook {

    @Override
    public String doAfter(String key, ProceedingJoinPoint joinPoint, RequestLock requestLock) {
        return requestLock.delimiter()  + "prefix="+requestLock.prefix() + key;
    }

}
